<div class="content">
  <button mat-button  (click)="goBack()" class="return">返回</button>
  <h2 class="forumTitle">{{forum.title}}</h2>
  <p class="forumAuthor">
    <span>发表时间：{{forum.pubdate | date:'yyyy-MM-dd'}}</span>
    <span style="margin-left: 14px">作者：{{forum.author}}</span>
  </p>
  <div class="forumContent" [innerHTML]="forum.content">

  </div>
  <p class="prise">
    <span (click)="addZan()" >点赞 {{zanCount}}</span>
    <span>评论 {{commentCount}}</span>
  </p>

  <div class="allComments">
    <h3>所有评论</h3>
    <div class="commentBox" *ngFor="let comment of comments">
      <div class="commentInfo">
        <span>{{comment.sysUser.username}}</span>
        <span>{{comment.create_time | date:'yyyy-MM-dd'}}</span>
      </div>
      <span class="reply">评论内容：{{comment.content}}</span>

      <button mat-button class="replyBtn" (click)="getReply(comment.id,comment)">查看回复</button>
      <button mat-button class="replyBtn" (click)="changeReply(comment)">回复</button>
      <button *ngIf="comment.from_uid == user.id"  mat-button class="replyBtn" (click)="deleteComment(comment.id)">删除评论</button>

      <div *ngIf="comment.replayValue">
        <textarea class="replyTextarea" matInput [(ngModel)]="comment.reply" name="replyContent"></textarea>
        <button mat-button style="float: right" (click)="insertReply(comment)">确认</button>
        <div style="clear:both"></div>
      </div>
      <ul *ngIf="comment.selectComment">
        <li *ngFor="let reply of comment.replys">回复：{{reply.content}}</li>
        <a class="replyBtn" (click)="hideReply(comment)" style="margin-top: -8px;color: #3e4fb2;cursor: pointer" title="收起">^</a>
      </ul>
    </div>
  </div>

  <div class="myComment">
    <h3>发表评论</h3>
    <mat-form-field appearance="standard" class="commentTextarea">

      <textarea name="commentContent" matInput  [(ngModel)]="comment.content"></textarea>
      <!--<input matInput required [(ngModel)]="comment.content" name="content">-->
    </mat-form-field>
    <button mat-button color="primary" class="add-btn" (click)="addComment()">确认发表</button>

  </div>
</div>
